
<form id="form_add">
<input type="hidden" name="id" value="{[$smarty.request.id]}" />
<input type="hidden" name="info" id="info" value="" />
<input type="hidden" name="requote" value="{[$smarty.request.requote]}" />
<table>
	<tr>
		<td align="right">项目编号：</td>
		<td>{[$quote.code]}</td>
	</tr>
	<tr>
		<td align="right">产品套数：</td>
		<td><input type="text" name="num" id="num" size="20" value="{[$quote.num]}"></td>
	</tr>
	<tr>
		<td align="right">备注：</td>
		<td><textarea rows="4" name="content" cols="55"></textarea></td>
	</tr>
	<tr>
		<td width="20%" align="right">文件名：</td>
		<td width="80%"><select name='filename' id='filename'>
			{[html_options options=$filename_option selected=safe]}
		</select></td>
	</tr>
	<tr>
		<td align="right">附件：</td>
		<td><input type="file" name="userfile" id="userfile" size="42" value=""></td>
	</tr>
</table>
</form>

<script type="text/javascript" src="js/customer/quote/info/add.js?r={[$smarty.now]}"></script>

<script type="text/javascript">
$(function() {

	$("#userfile").uploadify({
		'swf'       : '/js/uploadify/uploadify.swf',
		'uploader' : 'customer.php?do=QuoteInfo.ajax_upload',
				
		'buttonText': '请选择文件',
		
		'width'          : 130,
		'queueSizeLimit' : 10,
		'auto': false,
		'multi'          : true,
		'debug': false,
		'removeTimeout': 0.5,
		
		'fileTypeExts'		 : '*.pdf;*.zip;*.rar;*.jpg;*.png;*.xls;*.doc;*.xlsx;*.docx',
		'fileTypeDesc': 'All Files',
		'fileSizeLimit'		 : '100MB',
		'formData': {
			'quote': '{[$smarty.request.id]}',
			'oper':	'{[$smarty.session.id]}'
		},
		'onUploadStart':function(file) {
			
			$("#userfile").uploadify("settings", "formData", {
				'id': $('#info').val(),
				'name': $('#filename').val()
            });
        },
		'onUploadSuccess':function(file, data, response) {
			
			$('#userfile').uploadify('upload');
		},
		'onQueueComplete':function(queueData) {
		
			$('#dialog_add').dialog('close');
			}
	});
	
});
</script>
